<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>ROR Instruction</title>
<link href="../edit68k.css" rel="stylesheet" type="text/css">
</head>

<body>
<h1 class="heading">ROR Instruction<BR>
</h1>
<hr noshade></h1>
<BR>
        <span class="text">The instruction ROR rotates a data register or a memory operand to the right. There are three ways to do this:<BR>
        <BR>
1. Rotate a data register to the right. Number of steps is a constant.<BR>
2. Rotate a data register to the right. Number of steps is stored in another data register. You can rotate 1-8 bits this way.<BR>
3. Rotate a word in the memory one bit to the right.<BR>
<BR>
The rotation is done without an extra bit (i.e. a 8, 16 or 32 bit rotation). The bit that is rotated from the lowest position to the highest will also be send to the carry flag.</span></P>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="50%">
  <TBODY>
    <TR>
      <TD width="33%" align=middle class="text"><BIG>-- -- &gt;</BIG></TD>
      <TD width="17%" align=middle class="text">OPERAND</TD>
      <TD width="33%" align=middle class="text">-- -- &gt;</TD>
      <TD width="17%" align=middle class="text">C</TD>
    </TR>
  </TBODY>
</TABLE>
<P align=left class="text">ADDRESS METHODS: (An), (An)+, -(An), x(An), x(An,xr.s), x.w, x.l (only when rotating a word in the memory)<BR>
          <BR>
  DATA LENGTH: Byte, word, longword<BR>
          <BR>
  When rotating in the memory, you can only use word.</P>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="93%">
  <TBODY>
    <TR>
      <TD width="11%" rowSpan=5 vAlign=top class="text">FLAGS:</TD>
      <TD width="89%" class="text">X - U</TD>
    </TR>
    <TR>
      <TD width="89%" class="text">N - S</TD>
    </TR>
    <TR>
      <TD width="89%" class="text">Z - S</TD>
    </TR>
    <TR>
      <TD width="89%" class="text">C - Equal to the bit that was last moved from the operand. If number of steps is zero, the flag is cleared.</TD>
    </TR>
    <TR>
      <TD width="89%"><span class="text">V - 0 </span>
          <P>&nbsp;</P></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="62%">
  <TBODY>
    <TR>
      <TD width="16%" rowSpan=3 class="text">SYNTAX:</TD>
      <TD width="84%" class="text">ROL #&lt;steps&gt;,Dy</TD>
    </TR>
    <TR>
      <TD width="84%" class="text">ROL Dx,Dy</TD>
    </TR>
    <TR>
      <TD width="84%" class="text">ROL &lt;ea&gt;</TD>
    </TR>
  </TBODY>
</TABLE>
<P align=left><span class="text"><strong style="font-weight: 400">EXAMPLE CODE:</strong></span></P>
<P align=left class="sourcecode"><strong style="font-weight: 400">
<font face="Arial" size="2">&nbsp;&nbsp; ROL.B&nbsp;&nbsp;&nbsp; #1,D0&nbsp;&nbsp;&nbsp; if 
D0.B contained 00001111, it would now be 10000111</font></strong></P>
<P align=left><span class="text"><FONT color=#000080><STRONG></STRONG></FONT></span><FONT color=#000080 class="subheading"><STRONG></STRONG></FONT></P>
<P align=left><span class="text">
  </span>
</P>
</body>
</html>